<HTML><HEAD><TITLE>exp(+Number, -Result)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Arithmetic</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>exp(+Number, -Result)</H1>
Evaluates the exponential function exp(Number) ("e to the power of Number")
and unifies the resulting value with Result.


<DL>
<DT><EM>Number</EM></DT>
<DD>A number.
</DD>
<DT><EM>Result</EM></DT>
<DD>A variable, float or breal.
</DD>
</DL>
<H2>Description</H2>
   This predicate is used by the ECLiPSe compiler to expand evaluable
   arithmetic expressions.  So the call to exp(Number, Result) is
   equivalent to
<PRE>
    Result is exp(Number)
</PRE>
    which should be preferred for portability.
<P>
   In coroutining mode, if Number is uninstantiated, the call to exp/2 is
   delayed until this variable is instantiated.

<P>

<H3>Modes and Determinism</H3><UL>
<LI>exp(+, -) is det
</UL>
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>Number is not instantiated (non-coroutining mode only).
<DT><EM>(24) number expected </EM>
<DD>Number is not of a numeric type.
</DL>
<H2>Examples</H2>
<PRE>
Success:
      exp(0.0, Result).       (gives Result = 1.0)
      exp(-6, Result).        (gives Result = 0.00247875)
Fail:
      exp(1, 0.0).
      exp(0, 1).
      exp(1, r).
Error:
      exp(A, 6.0).                   (Error 4).
      exp(4 + 2, 403.429).           (Error 24).



</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/arithmetic/is-2.html">is / 2</A>
</BODY></HTML>
